package com.dynamic.mybatis.bootstrap.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DataSourceConfig {
    /**
     * @Bean 内添加名字多数据源会根据这个key路由
     * @return
     */
    @Bean("dms")
    @ConfigurationProperties(prefix = "spring.datasource")
    public DruidDataSource datasource(){
        return new DruidDataSource();
    }
}
